load("../analysis/data/.RData")
#load("../analysis/data/RData.dms")
QBCrossSectional$Week <- as.factor(QBCrossSectional$Week)
attach(QBCrossSectional)
## The following object is masked from package:ggplot2:
##
## Position
head(QBCrossSectional)
## # A tibble: 6 x 21
## PlayerID Week Position Opponent TeamIsHome GameDate PassingCompleti…
## <dbl> <fct> <chr> <chr> <lgl> <date> <dbl>
## 1 6739 13 QB NYJ FALSE 2017-12-03 19
## 2 4314 3 QB HOU TRUE 2017-09-24 25
## 3 13320 10 QB MIA TRUE 2017-11-13 21
## 4 18857 5 QB KC TRUE 2017-10-08 16
## 5 14536 8 QB HOU TRUE 2017-10-29 26
## 6 18857 4 QB TEN TRUE 2017-10-01 25
## # … with 14 more variables: PassingAttempts <dbl>,
## # PassingCompletionPercentage <dbl>, PassingYards <dbl>,
## # PassingYardsPerAttempt <dbl>, PassingTouchdowns <dbl>,
## # PassingInterceptions <dbl>, PassingRating <dbl>,
## # RushingAttempts <dbl>, RushingYards <dbl>,
## # RushingYardsPerAttempt <dbl>, RushingTouchdowns <dbl>,
## # FumblesLost <dbl>, FantasyPoints <dbl>, Team <chr>
summary(QBCrossSectional)
## PlayerID Week Position Opponent
## Min. : 611 2 : 30 Length:453 Length:453
## 1st Qu.: 7242 13 : 29 Class :character Class :character
## Median :13723 14 : 29 Mode :character Mode :character
## Mean :11932 3 : 28
## 3rd Qu.:16763 4 : 28
## Max. :19029 12 : 28
## (Other):281
## TeamIsHome GameDate PassingCompletions PassingAttempts
## Mode :logical Min. :2017-09-07 Min. : 5.00 Min. :10.00
## FALSE:226 1st Qu.:2017-10-08 1st Qu.:18.00 1st Qu.:29.00
## TRUE :227 Median :2017-11-05 Median :21.00 Median :33.00
## Mean :2017-11-05 Mean :21.24 Mean :33.62
## 3rd Qu.:2017-12-03 3rd Qu.:25.00 3rd Qu.:38.00
## Max. :2017-12-31 Max. :44.00 Max. :66.00
##
## PassingCompletionPercentage PassingYards PassingYardsPerAttempt
## Min. :38.70 Min. : 57.0 Min. : 3.100
## 1st Qu.:57.10 1st Qu.:199.0 1st Qu.: 6.200
## Median :63.20 Median :241.0 Median : 7.200
## Mean :63.48 Mean :244.6 Mean : 7.378
## 3rd Qu.:69.40 3rd Qu.:291.0 3rd Qu.: 8.400
## Max. :87.00 Max. :506.0 Max. :14.100
##
## PassingTouchdowns PassingInterceptions PassingRating RushingAttempts
## Min. :0.000 Min. :0.00 Min. : 31.14 Min. : 0.000
## 1st Qu.:1.000 1st Qu.:0.00 1st Qu.: 77.92 1st Qu.: 1.000
## Median :1.000 Median :0.00 Median : 92.94 Median : 3.000
## Mean :1.587 Mean :0.66 Mean : 93.88 Mean : 3.185
## 3rd Qu.:2.000 3rd Qu.:1.00 3rd Qu.:109.84 3rd Qu.: 5.000
## Max. :5.000 Max. :4.00 Max. :150.69 Max. :14.000
##
## RushingYards RushingYardsPerAttempt RushingTouchdowns FumblesLost
## Min. :-8.00 Min. :-2.700 Min. :0.0000 Min. :0.0000
## 1st Qu.: 0.00 1st Qu.: 0.000 1st Qu.:0.0000 1st Qu.:0.0000
## Median : 8.00 Median : 3.000 Median :0.0000 Median :0.0000
## Mean :14.38 Mean : 3.839 Mean :0.1457 Mean :0.1766
## 3rd Qu.:23.00 3rd Qu.: 6.000 3rd Qu.:0.0000 3rd Qu.:0.0000
## Max. :95.00 Max. :70.000 Max. :2.0000 Max. :3.0000
##
## FantasyPoints Team
## Min. : 7.12 Length:453
## 1st Qu.:11.86 Class :character
## Median :15.86 Mode :character
## Mean :16.89
## 3rd Qu.:20.68
## Max. :37.64
##
str(QBPanels)
## List of 17
## $ Opponent :Classes 'tbl_df', 'tbl' and 'data.frame': 56 obs. of 18 variables:
## ..$ PlayerID: num [1:56] 611 732 2428 2593 3807 ...
## ..$ 1 : chr [1:56] NA "CHI" "DET" "SEA" ...
## ..$ 2 : chr [1:56] "CLE" "GB" "IND" "ATL" ...
## ..$ 3 : chr [1:56] NA "DET" "DAL" "CIN" ...
## ..$ 4 : chr [1:56] "PIT" "BUF" "SF" "CHI" ...
## ..$ 5 : chr [1:56] "OAK" NA "PHI" "DAL" ...
## ..$ 6 : chr [1:56] NA "MIA" "TB" NA ...
## ..$ 7 : chr [1:56] "MIN" "NE" NA NA ...
## ..$ 8 : chr [1:56] "MIA" "NYJ" NA NA ...
## ..$ 9 : chr [1:56] "TEN" "CAR" NA NA ...
## ..$ 10 : chr [1:56] NA "DAL" NA NA ...
## ..$ 11 : chr [1:56] "GB" "SEA" NA NA ...
## ..$ 12 : chr [1:56] "HOU" "TB" NA NA ...
## ..$ 13 : chr [1:56] "DET" NA NA NA ...
## ..$ 14 : chr [1:56] "PIT" NA NA NA ...
## ..$ 15 : chr [1:56] "CLE" "TB" NA "CAR" ...
## ..$ 16 : chr [1:56] "IND" "NO" NA NA ...
## ..$ 17 : chr [1:56] "CIN" "CAR" NA NA ...
## $ TeamIsHome :Classes 'tbl_df', 'tbl' and 'data.frame': 56 obs. of 18 variables:
## ..$ PlayerID: num [1:56] 611 732 2428 2593 3807 ...
## ..$ 1 : logi [1:56] NA FALSE FALSE TRUE FALSE TRUE ...
## ..$ 2 : logi [1:56] TRUE TRUE FALSE FALSE TRUE FALSE ...
## ..$ 3 : logi [1:56] NA FALSE TRUE TRUE FALSE TRUE ...
## ..$ 4 : logi [1:56] TRUE TRUE TRUE TRUE FALSE TRUE ...
## ..$ 5 : logi [1:56] FALSE NA FALSE FALSE NA FALSE ...
## ..$ 6 : logi [1:56] NA TRUE TRUE NA FALSE FALSE ...
## ..$ 7 : logi [1:56] FALSE FALSE NA NA TRUE TRUE ...
## ..$ 8 : logi [1:56] TRUE FALSE NA NA FALSE TRUE ...
## ..$ 9 : logi [1:56] FALSE FALSE NA NA NA NA ...
## ..$ 10 : logi [1:56] NA TRUE NA NA FALSE FALSE ...
## ..$ 11 : logi [1:56] FALSE FALSE NA NA TRUE FALSE ...
## ..$ 12 : logi [1:56] TRUE TRUE NA NA TRUE TRUE ...
## ..$ 13 : logi [1:56] TRUE NA NA NA FALSE FALSE ...
## ..$ 14 : logi [1:56] FALSE NA NA NA TRUE FALSE ...
## ..$ 15 : logi [1:56] FALSE FALSE NA FALSE TRUE FALSE ...
## ..$ 16 : logi [1:56] TRUE FALSE NA NA FALSE TRUE ...
## ..$ 17 : logi [1:56] TRUE TRUE NA NA NA TRUE ...
## $ PassingCompletions :Classes 'tbl_df', 'tbl' and 'data.frame': 56 obs. of 18 variables:
## ..$ PlayerID: num [1:56] 611 732 2428 2593 3807 ...
## ..$ 1 : num [1:56] NA 21 27 28 24 16 NA NA 26 NA ...
## ..$ 2 : num [1:56] 25 19 19 33 23 30 NA 22 16 NA ...
## ..$ 3 : num [1:56] NA 24 29 28 22 25 NA 35 18 NA ...
## ..$ 4 : num [1:56] 31 24 33 18 18 32 NA 30 NA NA ...
## ..$ 5 : num [1:56] 19 NA 28 19 NA 30 NA 21 23 NA ...
## ..$ 6 : num [1:56] NA 24 18 NA 17 20 NA 11 31 NA ...
## ..$ 7 : num [1:56] 27 23 NA NA 14 21 NA 19 17 13 ...
## ..$ 8 : num [1:56] 10 18 NA NA 17 32 NA NA 26 NA ...
## ..$ 9 : num [1:56] 34 24 NA NA NA NA 15 20 14 NA ...
## ..$ 10 : num [1:56] NA 22 NA NA 19 25 24 28 23 NA ...
## ..$ 11 : num [1:56] 22 19 NA NA 30 30 NA 19 NA 17 ...
## ..$ 12 : num [1:56] 20 26 NA NA 33 18 NA NA 19 23 ...
## ..$ 13 : num [1:56] 23 NA NA NA 24 21 NA NA 26 NA ...
## ..$ 14 : num [1:56] 20 NA NA NA 44 24 NA 31 NA NA ...
## ..$ 15 : num [1:56] 26 17 NA 26 22 22 NA 37 NA NA ...
## ..$ 16 : num [1:56] 29 22 NA NA 20 21 20 NA NA NA ...
## ..$ 17 : num [1:56] 25 28 NA NA NA 18 15 NA NA NA ...
## $ PassingAttempts :Classes 'tbl_df', 'tbl' and 'data.frame': 56 obs. of 18 variables:
## ..$ PlayerID: num [1:56] 611 732 2428 2593 3807 ...
## ..$ 1 : num [1:56] NA 30 48 42 36 36 NA NA 39 NA ...
## ..$ 2 : num [1:56] 34 28 36 50 35 39 NA 32 24 NA ...
## ..$ 3 : num [1:56] NA 35 48 42 39 35 NA 47 23 NA ...
## ..$ 4 : num [1:56] 49 42 51 26 30 45 NA 49 NA NA ...
## ..$ 5 : num [1:56] 26 NA 44 29 NA 40 NA 36 30 NA ...
## ..$ 6 : num [1:56] NA 35 22 NA 25 38 NA 19 47 NA ...
## ..$ 7 : num [1:56] 39 33 NA NA 24 29 NA 39 27 21 ...
## ..$ 8 : num [1:56] 15 29 NA NA 31 47 NA NA 33 NA ...
## ..$ 9 : num [1:56] 52 38 NA NA NA NA 30 36 20 NA ...
## ..$ 10 : num [1:56] NA 29 NA NA 31 34 47 37 39 NA ...
## ..$ 11 : num [1:56] 28 27 NA NA 45 37 NA 35 NA 28 ...
## ..$ 12 : num [1:56] 32 35 NA NA 45 28 NA NA 36 34 ...
## ..$ 13 : num [1:56] 36 NA NA NA 40 30 NA NA 36 NA ...
## ..$ 14 : num [1:56] 35 NA NA NA 66 43 NA 46 NA NA ...
## ..$ 15 : num [1:56] 42 31 NA 45 30 35 NA 57 NA NA ...
## ..$ 16 : num [1:56] 38 36 NA NA 29 28 34 NA NA NA ...
## ..$ 17 : num [1:56] 47 45 NA NA NA 37 34 NA NA NA ...
## $ PassingCompletionPercentage:Classes 'tbl_df', 'tbl' and 'data.frame': 56 obs. of 18 variables:
## ..$ PlayerID: num [1:56] 611 732 2428 2593 3807 ...
## ..$ 1 : num [1:56] NA 70 56.2 66.7 66.7 44.4 NA NA 66.7 NA ...
## ..$ 2 : num [1:56] 73.5 67.9 52.8 66 65.7 76.9 NA 68.8 66.7 NA ...
## ..$ 3 : num [1:56] NA 68.6 60.4 66.7 56.4 71.4 NA 74.5 78.3 NA ...
## ..$ 4 : num [1:56] 63.3 57.1 64.7 69.2 60 71.1 NA 61.2 NA NA ...
## ..$ 5 : num [1:56] 73.1 NA 63.6 65.5 NA 75 NA 58.3 76.7 NA ...
## ..$ 6 : num [1:56] NA 68.6 81.8 NA 68 52.6 NA 57.9 66 NA ...
## ..$ 7 : num [1:56] 69.2 69.7 NA NA 58.3 72.4 NA 48.7 63 61.9 ...
## ..$ 8 : num [1:56] 66.7 62.1 NA NA 54.8 68.1 NA NA 78.8 NA ...
## ..$ 9 : num [1:56] 65.4 63.2 NA NA NA NA 50 55.6 70 NA ...
## ..$ 10 : num [1:56] NA 75.9 NA NA 61.3 73.5 51.1 75.7 59 NA ...
## ..$ 11 : num [1:56] 78.6 70.4 NA NA 66.7 81.1 NA 54.3 NA 60.7 ...
## ..$ 12 : num [1:56] 62.5 74.3 NA NA 73.3 64.3 NA NA 52.8 67.6 ...
## ..$ 13 : num [1:56] 63.9 NA NA NA 60 70 NA NA 72.2 NA ...
## ..$ 14 : num [1:56] 57.1 NA NA NA 66.7 55.8 NA 67.4 NA NA ...
## ..$ 15 : num [1:56] 61.9 54.8 NA 57.8 73.3 62.9 NA 64.9 NA NA ...
## ..$ 16 : num [1:56] 76.3 61.1 NA NA 69 75 58.8 NA NA NA ...
## ..$ 17 : num [1:56] 53.2 62.2 NA NA NA 48.6 44.1 NA NA NA ...
## $ PassingYards :Classes 'tbl_df', 'tbl' and 'data.frame': 56 obs. of 18 variables:
## ..$ PlayerID: num [1:56] 611 732 2428 2593 3807 ...
## ..$ 1 : num [1:56] NA 321 268 311 263 267 NA NA 187 NA ...
## ..$ 2 : num [1:56] 217 252 332 343 243 447 NA 239 166 NA ...
## ..$ 3 : num [1:56] NA 294 325 313 235 378 NA 366 249 NA ...
## ..$ 4 : num [1:56] 235 242 357 179 216 307 NA 288 NA NA ...
## ..$ 5 : num [1:56] 222 NA 291 221 NA 303 NA 225 194 NA ...
## ..$ 6 : num [1:56] NA 248 283 NA 252 257 NA 128 354 NA ...
## ..$ 7 : num [1:56] 186 233 NA NA 224 249 NA 134 209 188 ...
## ..$ 8 : num [1:56] 101 254 NA NA 317 333 NA NA 257 NA ...
## ..$ 9 : num [1:56] 261 313 NA NA NA NA 201 220 140 NA ...
## ..$ 10 : num [1:56] NA 215 NA NA 236 266 273 273 262 NA ...
## ..$ 11 : num [1:56] 183 195 NA NA 299 340 NA 205 NA 282 ...
## ..$ 12 : num [1:56] 141 317 NA NA 351 227 NA NA 307 215 ...
## ..$ 13 : num [1:56] 269 NA NA NA 290 258 NA NA 331 NA ...
## ..$ 14 : num [1:56] 269 NA NA NA 506 233 NA 228 NA NA ...
## ..$ 15 : num [1:56] 288 212 NA 290 281 298 NA 434 NA NA ...
## ..$ 16 : num [1:56] 237 288 NA NA 226 224 209 NA NA NA ...
## ..$ 17 : num [1:56] 203 317 NA NA NA 190 145 NA NA NA ...
## $ PassingYardsPerAttempt :Classes 'tbl_df', 'tbl' and 'data.frame': 56 obs. of 18 variables:
## ..$ PlayerID: num [1:56] 611 732 2428 2593 3807 ...
## ..$ 1 : num [1:56] NA 10.7 5.6 7.4 7.3 7.4 NA NA 4.8 NA ...
## ..$ 2 : num [1:56] 6.4 9 9.2 6.9 6.9 11.5 NA 7.5 6.9 NA ...
## ..$ 3 : num [1:56] NA 8.4 6.8 7.5 6 10.8 NA 7.8 10.8 NA ...
## ..$ 4 : num [1:56] 4.8 5.8 7 6.9 7.2 6.8 NA 5.9 NA NA ...
## ..$ 5 : num [1:56] 8.5 NA 6.6 7.6 NA 7.6 NA 6.2 6.5 NA ...
## ..$ 6 : num [1:56] NA 7.1 12.9 NA 10.1 6.8 NA 6.7 7.5 NA ...
## ..$ 7 : num [1:56] 4.8 7.1 NA NA 9.3 8.6 NA 3.4 7.7 9 ...
## ..$ 8 : num [1:56] 6.7 8.8 NA NA 10.2 7.1 NA NA 7.8 NA ...
## ..$ 9 : num [1:56] 5 8.2 NA NA NA NA 6.7 6.1 7 NA ...
## ..$ 10 : num [1:56] NA 7.4 NA NA 7.6 7.8 5.8 7.4 6.7 NA ...
## ..$ 11 : num [1:56] 6.5 7.2 NA NA 6.6 9.2 NA 5.9 NA 10.1 ...
## ..$ 12 : num [1:56] 4.4 9.1 NA NA 7.8 8.1 NA NA 8.5 6.3 ...
## ..$ 13 : num [1:56] 7.5 NA NA NA 7.2 8.6 NA NA 9.2 NA ...
## ..$ 14 : num [1:56] 7.7 NA NA NA 7.7 5.4 NA 5 NA NA ...
## ..$ 15 : num [1:56] 6.9 6.8 NA 6.4 9.4 8.5 NA 7.6 NA NA ...
## ..$ 16 : num [1:56] 6.2 8 NA NA 7.8 8 6.1 NA NA NA ...
## ..$ 17 : num [1:56] 4.3 7 NA NA NA 5.1 4.3 NA NA NA ...
## $ PassingTouchdowns :Classes 'tbl_df', 'tbl' and 'data.frame': 56 obs. of 18 variables:
## ..$ PlayerID: num [1:56] 611 732 2428 2593 3807 ...
## ..$ 1 : num [1:56] NA 1 1 1 2 0 NA NA 0 NA ...
## ..$ 2 : num [1:56] 2 1 1 2 2 3 NA 1 2 NA ...
## ..$ 3 : num [1:56] NA 2 2 3 1 5 NA 3 1 NA ...
## ..$ 4 : num [1:56] 1 1 1 4 1 2 NA 2 NA NA ...
## ..$ 5 : num [1:56] 0 NA 1 3 NA 1 NA 2 2 NA ...
## ..$ 6 : num [1:56] NA 1 3 NA 1 2 NA 1 2 NA ...
## ..$ 7 : num [1:56] 1 1 NA NA 2 2 NA 1 3 2 ...
## ..$ 8 : num [1:56] 1 2 NA NA 1 1 NA NA 2 NA ...
## ..$ 9 : num [1:56] 2 2 NA NA NA NA 2 2 1 NA ...
## ..$ 10 : num [1:56] NA 2 NA NA 2 3 1 2 1 NA ...
## ..$ 11 : num [1:56] 1 2 NA NA 4 3 NA 0 NA 1 ...
## ..$ 12 : num [1:56] 0 1 NA NA 4 4 NA NA 3 1 ...
## ..$ 13 : num [1:56] 2 NA NA NA 2 0 NA NA 1 NA ...
## ..$ 14 : num [1:56] 2 NA NA NA 2 1 NA 1 NA NA ...
## ..$ 15 : num [1:56] 1 1 NA 3 2 1 NA 3 NA NA ...
## ..$ 16 : num [1:56] 2 1 NA NA 2 2 2 NA NA NA ...
## ..$ 17 : num [1:56] 2 1 NA NA NA 2 1 NA NA NA ...
## $ PassingInterceptions :Classes 'tbl_df', 'tbl' and 'data.frame': 56 obs. of 18 variables:
## ..$ PlayerID: num [1:56] 611 732 2428 2593 3807 ...
## ..$ 1 : num [1:56] NA 0 3 1 1 0 NA NA 2 NA ...
## ..$ 2 : num [1:56] 1 0 1 1 0 0 NA 1 0 NA ...
## ..$ 3 : num [1:56] NA 3 0 1 0 0 NA 2 0 NA ...
## ..$ 4 : num [1:56] 2 2 1 0 1 0 NA 0 NA NA ...
## ..$ 5 : num [1:56] 0 NA 0 0 NA 1 NA 1 1 NA ...
## ..$ 6 : num [1:56] NA 1 1 NA 1 1 NA 0 2 NA ...
## ..$ 7 : num [1:56] 0 0 NA NA 0 0 NA 0 1 1 ...
## ..$ 8 : num [1:56] 0 0 NA NA 1 0 NA NA 0 NA ...
## ..$ 9 : num [1:56] 2 1 NA NA NA NA 1 1 0 NA ...
## ..$ 10 : num [1:56] NA 1 NA NA 1 0 0 0 1 NA ...
## ..$ 11 : num [1:56] 1 0 NA NA 0 0 NA 0 NA 0 ...
## ..$ 12 : num [1:56] 0 0 NA NA 2 1 NA NA 0 2 ...
## ..$ 13 : num [1:56] 0 NA NA NA 1 1 NA NA 0 NA ...
## ..$ 14 : num [1:56] 1 NA NA NA 0 2 NA 2 NA NA ...
## ..$ 15 : num [1:56] 0 0 NA 3 1 1 NA 1 NA NA ...
## ..$ 16 : num [1:56] 0 1 NA NA 0 1 2 NA NA NA ...
## ..$ 17 : num [1:56] 1 0 NA NA NA 0 1 NA NA NA ...
## $ PassingRating :Classes 'tbl_df', 'tbl' and 'data.frame': 56 obs. of 18 variables:
## ..$ PlayerID: num [1:56] 611 732 2428 2593 3807 ...
## ..$ 1 : num [1:56] NA 116.1 53.1 86.5 95 ...
## ..$ 2 : num [1:56] 97.3 108 82.2 90.7 104.8 ...
## ..$ 3 : num [1:56] NA 77.6 94.5 102.6 82.8 ...
## ..$ 4 : num [1:56] 64.6 61.8 83.5 128 79.3 ...
## ..$ 5 : num [1:56] 98.6 NA 90.2 122.9 NA ...
## ..$ 6 : num [1:56] NA 86.4 139.4 NA 97.4 ...
## ..$ 7 : num [1:56] 88.2 99.7 NA NA 117.4 ...
## ..$ 8 : num [1:56] 107.9 113.3 NA NA 87.7 ...
## ..$ 9 : num [1:56] 74.3 95.6 NA NA NA ...
## ..$ 10 : num [1:56] NA 104.8 NA NA 92.9 ...
## ..$ 11 : num [1:56] 90.9 115.5 NA NA 115 ...
## ..$ 12 : num [1:56] 72.5 111.2 NA NA 106.8 ...
## ..$ 13 : num [1:56] 105 NA NA NA 88.5 ...
## ..$ 14 : num [1:56] 88.9 NA NA NA 99.7 ...
## ..$ 15 : num [1:56] 90.2 87 NA 71.5 110.6 ...
## ..$ 16 : num [1:56] 109 84 NA NA 115 ...
## ..$ 17 : num [1:56] 69.7 90.7 NA NA NA ...
## $ RushingAttempts :Classes 'tbl_df', 'tbl' and 'data.frame': 56 obs. of 18 variables:
## ..$ PlayerID: num [1:56] 611 732 2428 2593 3807 ...
## ..$ 1 : num [1:56] NA 3 1 7 3 2 NA NA 2 NA ...
## ..$ 2 : num [1:56] 1 1 3 2 2 2 NA 0 4 NA ...
## ..$ 3 : num [1:56] NA 1 3 4 1 1 NA 0 4 NA ...
## ..$ 4 : num [1:56] 0 1 2 1 1 1 NA 3 NA NA ...
## ..$ 5 : num [1:56] 3 NA 0 4 NA 2 NA 0 3 NA ...
## ..$ 6 : num [1:56] NA 0 5 NA 2 1 NA 1 3 NA ...
## ..$ 7 : num [1:56] 1 3 NA NA 3 5 NA 0 3 0 ...
## ..$ 8 : num [1:56] 1 6 NA NA 3 1 NA NA 1 NA ...
## ..$ 9 : num [1:56] 1 1 NA NA NA NA 4 0 5 NA ...
## ..$ 10 : num [1:56] NA 0 NA NA 2 1 1 0 0 NA ...
## ..$ 11 : num [1:56] 2 3 NA NA 1 0 NA 2 NA 1 ...
## ..$ 12 : num [1:56] 6 1 NA NA 3 5 NA NA 2 2 ...
## ..$ 13 : num [1:56] 1 NA NA NA 1 0 NA NA 7 NA ...
## ..$ 14 : num [1:56] 0 NA NA NA 1 0 NA 0 NA NA ...
## ..$ 15 : num [1:56] 4 3 NA 6 3 2 NA 0 NA NA ...
## ..$ 16 : num [1:56] 4 2 NA NA 1 2 2 NA NA NA ...
## ..$ 17 : num [1:56] 0 3 NA NA NA 0 1 NA NA NA ...
## $ RushingYards :Classes 'tbl_df', 'tbl' and 'data.frame': 56 obs. of 18 variables:
## ..$ PlayerID: num [1:56] 611 732 2428 2593 3807 ...
## ..$ 1 : num [1:56] NA 11 2 21 -8 0 NA NA 0 NA ...
## ..$ 2 : num [1:56] -1 8 6 8 -2 9 NA 0 31 NA ...
## ..$ 3 : num [1:56] NA -1 7 23 6 6 NA 0 7 NA ...
## ..$ 4 : num [1:56] 0 8 1 -1 -1 2 NA 22 NA NA ...
## ..$ 5 : num [1:56] -4 NA 0 32 NA 5 NA 0 -3 NA ...
## ..$ 6 : num [1:56] NA 0 -4 NA -2 -1 NA 0 21 NA ...
## ..$ 7 : num [1:56] 0 37 NA NA -3 5 NA 0 1 0 ...
## ..$ 8 : num [1:56] 9 17 NA NA -2 2 NA NA 0 NA ...
## ..$ 9 : num [1:56] 7 -1 NA NA NA NA 2 0 13 NA ...
## ..$ 10 : num [1:56] NA 0 NA NA 5 0 1 0 0 NA ...
## ..$ 11 : num [1:56] -1 12 NA NA 10 0 NA 5 NA 0 ...
## ..$ 12 : num [1:56] 42 1 NA NA 25 -4 NA NA 28 9 ...
## ..$ 13 : num [1:56] -1 NA NA NA 4 0 NA NA 19 NA ...
## ..$ 14 : num [1:56] 0 NA NA NA 5 0 NA 0 NA NA ...
## ..$ 15 : num [1:56] 3 29 NA 43 10 -2 NA 0 NA NA ...
## ..$ 16 : num [1:56] -2 7 NA NA -1 6 1 NA NA NA ...
## ..$ 17 : num [1:56] 0 14 NA NA NA 0 -1 NA NA NA ...
## $ RushingYardsPerAttempt :Classes 'tbl_df', 'tbl' and 'data.frame': 56 obs. of 18 variables:
## ..$ PlayerID: num [1:56] 611 732 2428 2593 3807 ...
## ..$ 1 : num [1:56] NA 3.7 2 3 -2.7 0 NA NA 0 NA ...
## ..$ 2 : num [1:56] -1 8 2 4 -1 4.5 NA 0 7.8 NA ...
## ..$ 3 : num [1:56] NA -1 2.3 5.8 6 6 NA 0 1.8 NA ...
## ..$ 4 : num [1:56] 0 8 0.5 -1 -1 2 NA 7.3 NA NA ...
## ..$ 5 : num [1:56] -1.3 NA 0 8 NA 2.5 NA 0 -1 NA ...
## ..$ 6 : num [1:56] NA 0 -0.8 NA -1 -1 NA 0 7 NA ...
## ..$ 7 : num [1:56] 0 12.3 NA NA -1 1 NA 0 0.3 0 ...
## ..$ 8 : num [1:56] 9 2.8 NA NA -0.7 2 NA NA 0 NA ...
## ..$ 9 : num [1:56] 7 -1 NA NA NA NA 0.5 0 2.6 NA ...
## ..$ 10 : num [1:56] NA 0 NA NA 2.5 0 1 0 0 NA ...
## ..$ 11 : num [1:56] -0.5 4 NA NA 10 0 NA 2.5 NA 0 ...
## ..$ 12 : num [1:56] 7 1 NA NA 8.3 -0.8 NA NA 14 4.5 ...
## ..$ 13 : num [1:56] -1 NA NA NA 4 0 NA NA 2.7 NA ...
## ..$ 14 : num [1:56] 0 NA NA NA 5 0 NA 0 NA NA ...
## ..$ 15 : num [1:56] 0.8 9.7 NA 7.2 3.3 -1 NA 0 NA NA ...
## ..$ 16 : num [1:56] -0.5 3.5 NA NA -1 3 0.5 NA NA NA ...
## ..$ 17 : num [1:56] 0 4.7 NA NA NA 0 -1 NA NA NA ...
## $ RushingTouchdowns :Classes 'tbl_df', 'tbl' and 'data.frame': 56 obs. of 18 variables:
## ..$ PlayerID: num [1:56] 611 732 2428 2593 3807 ...
## ..$ 1 : num [1:56] NA 0 0 0 0 0 NA NA 1 NA ...
## ..$ 2 : num [1:56] 0 0 0 0 0 0 NA 0 0 NA ...
## ..$ 3 : num [1:56] NA 0 0 0 0 0 NA 0 0 NA ...
## ..$ 4 : num [1:56] 0 0 0 0 0 0 NA 1 NA NA ...
## ..$ 5 : num [1:56] 0 NA 0 0 NA 0 NA 0 0 NA ...
## ..$ 6 : num [1:56] NA 0 0 NA 0 0 NA 0 0 NA ...
## ..$ 7 : num [1:56] 0 0 NA NA 0 0 NA 0 1 0 ...
## ..$ 8 : num [1:56] 0 0 NA NA 0 0 NA NA 0 NA ...
## ..$ 9 : num [1:56] 0 0 NA NA NA NA 0 0 1 NA ...
## ..$ 10 : num [1:56] NA 0 NA NA 0 0 0 0 0 NA ...
## ..$ 11 : num [1:56] 0 0 NA NA 0 0 NA 0 NA 0 ...
## ..$ 12 : num [1:56] 0 0 NA NA 0 0 NA NA 0 0 ...
## ..$ 13 : num [1:56] 0 NA NA NA 0 0 NA NA 2 NA ...
## ..$ 14 : num [1:56] 0 NA NA NA 0 0 NA 0 NA NA ...
## ..$ 15 : num [1:56] 1 0 NA 0 0 0 NA 0 NA NA ...
## ..$ 16 : num [1:56] 0 0 NA NA 0 0 0 NA NA NA ...
## ..$ 17 : num [1:56] 0 0 NA NA NA 0 0 NA NA NA ...
## $ FumblesLost :Classes 'tbl_df', 'tbl' and 'data.frame': 56 obs. of 18 variables:
## ..$ PlayerID: num [1:56] 611 732 2428 2593 3807 ...
## ..$ 1 : num [1:56] NA 0 0 0 0 0 NA NA 0 NA ...
## ..$ 2 : num [1:56] 0 0 0 1 0 0 NA 0 1 NA ...
## ..$ 3 : num [1:56] NA 0 0 0 1 1 NA 0 0 NA ...
## ..$ 4 : num [1:56] 0 1 0 0 0 0 NA 0 NA NA ...
## ..$ 5 : num [1:56] 0 NA 0 0 NA 1 NA 1 0 NA ...
## ..$ 6 : num [1:56] NA 0 0 NA 0 0 NA 0 0 NA ...
## ..$ 7 : num [1:56] 0 0 NA NA 0 0 NA 1 0 0 ...
## ..$ 8 : num [1:56] 0 2 NA NA 0 0 NA NA 0 NA ...
## ..$ 9 : num [1:56] 0 0 NA NA NA NA 0 1 0 NA ...
## ..$ 10 : num [1:56] NA 0 NA NA 0 0 0 1 0 NA ...
## ..$ 11 : num [1:56] 0 0 NA NA 0 0 NA 0 NA 0 ...
## ..$ 12 : num [1:56] 0 0 NA NA 0 1 NA NA 1 0 ...
## ..$ 13 : num [1:56] 0 NA NA NA 0 0 NA NA 0 NA ...
## ..$ 14 : num [1:56] 0 NA NA NA 0 0 NA 0 NA NA ...
## ..$ 15 : num [1:56] 0 0 NA 0 0 0 NA 0 NA NA ...
## ..$ 16 : num [1:56] 0 0 NA NA 0 0 0 NA NA NA ...
## ..$ 17 : num [1:56] 0 0 NA NA NA 0 0 NA NA NA ...
## $ FantasyPoints :Classes 'tbl_df', 'tbl' and 'data.frame': 56 obs. of 18 variables:
## ..$ PlayerID: num [1:56] 611 732 2428 2593 3807 ...
## ..$ 1 : num [1:56] NA 17.94 8.92 16.54 15.72 ...
## ..$ 2 : num [1:56] 14.6 14.9 15.9 18.5 17.5 ...
## ..$ 3 : num [1:56] NA 13.7 21.7 24.8 12 ...
## ..$ 4 : num [1:56] 9.4 8.48 16.38 23.06 10.54 ...
## ..$ 5 : num [1:56] 8.48 NA 15.64 24.04 NA ...
## ..$ 6 : num [1:56] NA 11.9 20.9 NA 11.9 ...
## ..$ 7 : num [1:56] 11.4 17 NA NA 16.7 ...
## ..$ 8 : num [1:56] 8.94 15.86 NA NA 14.48 ...
## ..$ 9 : num [1:56] 15.1 18.4 NA NA NA ...
## ..$ 10 : num [1:56] NA 14.6 NA NA 17.9 ...
## ..$ 11 : num [1:56] 9.22 17 NA NA 28.96 ...
## ..$ 12 : num [1:56] 9.84 16.78 NA NA 30.54 ...
## ..$ 13 : num [1:56] 18.7 NA NA NA 18 ...
## ..$ 14 : num [1:56] 16.8 NA NA NA 28.7 ...
## ..$ 15 : num [1:56] 21.8 15.4 NA 21.9 18.2 ...
## ..$ 16 : num [1:56] 17.3 14.2 NA NA 16.9 ...
## ..$ 17 : num [1:56] 14.1 18.1 NA NA NA ...
## $ Team :Classes 'tbl_df', 'tbl' and 'data.frame': 56 obs. of 18 variables:
## ..$ PlayerID: num [1:56] 611 732 2428 2593 3807 ...
## ..$ 1 : chr [1:56] NA "ATL" "ARI" "GB" ...
## ..$ 2 : chr [1:56] "BAL" "ATL" "ARI" "GB" ...
## ..$ 3 : chr [1:56] NA "ATL" "ARI" "GB" ...
## ..$ 4 : chr [1:56] "BAL" "ATL" "ARI" "GB" ...
## ..$ 5 : chr [1:56] "BAL" NA "ARI" "GB" ...
## ..$ 6 : chr [1:56] NA "ATL" "ARI" NA ...
## ..$ 7 : chr [1:56] "BAL" "ATL" NA NA ...
## ..$ 8 : chr [1:56] "BAL" "ATL" NA NA ...
## ..$ 9 : chr [1:56] "BAL" "ATL" NA NA ...
## ..$ 10 : chr [1:56] NA "ATL" NA NA ...
## ..$ 11 : chr [1:56] "BAL" "ATL" NA NA ...
## ..$ 12 : chr [1:56] "BAL" "ATL" NA NA ...
## ..$ 13 : chr [1:56] "BAL" NA NA NA ...
## ..$ 14 : chr [1:56] "BAL" NA NA NA ...
## ..$ 15 : chr [1:56] "BAL" "ATL" NA "GB" ...
## ..$ 16 : chr [1:56] "BAL" "ATL" NA NA ...
## ..$ 17 : chr [1:56] "BAL" "ATL" NA NA ...
vis_dat(QBCrossSectional[1:30,])
vis_dat(QBCrossSectional[31:60, ])
vis_dat(QBCrossSectional[61:89, ])
vis_dat(QBCrossSectional)
print(QBCrossSectional)
## # A tibble: 453 x 21
## PlayerID Week Position Opponent TeamIsHome GameDate PassingCompleti…
## <dbl> <fct> <chr> <chr> <lgl> <date> <dbl>
## 1 6739 13 QB NYJ FALSE 2017-12-03 19
## 2 4314 3 QB HOU TRUE 2017-09-24 25
## 3 13320 10 QB MIA TRUE 2017-11-13 21
## 4 18857 5 QB KC TRUE 2017-10-08 16
## 5 14536 8 QB HOU TRUE 2017-10-29 26
## 6 18857 4 QB TEN TRUE 2017-10-01 25
## 7 14536 3 QB TEN FALSE 2017-09-24 29
## 8 13320 4 QB NE FALSE 2017-10-01 22
## 9 18857 8 QB SEA FALSE 2017-10-29 19
## 10 13320 15 QB GB TRUE 2017-12-17 20
## # … with 443 more rows, and 14 more variables: PassingAttempts <dbl>,
## # PassingCompletionPercentage <dbl>, PassingYards <dbl>,
## # PassingYardsPerAttempt <dbl>, PassingTouchdowns <dbl>,
## # PassingInterceptions <dbl>, PassingRating <dbl>,
## # RushingAttempts <dbl>, RushingYards <dbl>,
## # RushingYardsPerAttempt <dbl>, RushingTouchdowns <dbl>,
## # FumblesLost <dbl>, FantasyPoints <dbl>, Team <chr>
print(QBPanels)
## $Opponent
## # A tibble: 56 x 18
## PlayerID `1` `2` `3` `4` `5` `6` `7` `8` `9` `10`
## <dbl> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
## 1 611 <NA> CLE <NA> PIT OAK <NA> MIN MIA TEN <NA>
## 2 732 CHI GB DET BUF <NA> MIA NE NYJ CAR DAL
## 3 2428 DET IND DAL SF PHI TB <NA> <NA> <NA> <NA>
## 4 2593 SEA ATL CIN CHI DAL <NA> <NA> <NA> <NA> <NA>
## 5 3807 CLE MIN CHI BAL <NA> KC CIN DET <NA> IND
## 6 4314 KC NO HOU CAR TB NYJ ATL LAC <NA> DEN
## 7 4737 <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> SF SEA
## 8 4932 <NA> DET PHI TB LAC DEN SEA <NA> LAR SF
## 9 5282 BUF OAK MIA <NA> CLE NE MIA ATL BUF TB
## 10 5834 <NA> <NA> <NA> <NA> <NA> <NA> NYJ <NA> <NA> <NA>
## # … with 46 more rows, and 7 more variables: `11` <chr>, `12` <chr>,
## # `13` <chr>, `14` <chr>, `15` <chr>, `16` <chr>, `17` <chr>
##
## $TeamIsHome
## # A tibble: 56 x 18
## PlayerID `1` `2` `3` `4` `5` `6` `7` `8` `9` `10`
## <dbl> <lgl> <lgl> <lgl> <lgl> <lgl> <lgl> <lgl> <lgl> <lgl> <lgl>
## 1 611 NA TRUE NA TRUE FALSE NA FALSE TRUE FALSE NA
## 2 732 FALSE TRUE FALSE TRUE NA TRUE FALSE FALSE FALSE TRUE
## 3 2428 FALSE FALSE TRUE TRUE FALSE TRUE NA NA NA NA
## 4 2593 TRUE FALSE TRUE TRUE FALSE NA NA NA NA NA
## 5 3807 FALSE TRUE FALSE FALSE NA FALSE TRUE FALSE NA FALSE
## 6 4314 TRUE FALSE TRUE TRUE FALSE FALSE TRUE TRUE NA FALSE
## 7 4737 NA NA NA NA NA NA NA NA FALSE TRUE
## 8 4932 NA TRUE FALSE FALSE TRUE FALSE TRUE NA TRUE FALSE
## 9 5282 FALSE FALSE TRUE NA FALSE TRUE FALSE TRUE TRUE FALSE
## 10 5834 NA NA NA NA NA NA TRUE NA NA NA
## # … with 46 more rows, and 7 more variables: `11` <lgl>, `12` <lgl>,
## # `13` <lgl>, `14` <lgl>, `15` <lgl>, `16` <lgl>, `17` <lgl>
##
## $PassingCompletions
## # A tibble: 56 x 18
## PlayerID `1` `2` `3` `4` `5` `6` `7` `8` `9` `10`
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 611 NA 25 NA 31 19 NA 27 10 34 NA
## 2 732 21 19 24 24 NA 24 23 18 24 22
## 3 2428 27 19 29 33 28 18 NA NA NA NA
## 4 2593 28 33 28 18 19 NA NA NA NA NA
## 5 3807 24 23 22 18 NA 17 14 17 NA 19
## 6 4314 16 30 25 32 30 20 21 32 NA 25
## 7 4737 NA NA NA NA NA NA NA NA 15 24
## 8 4932 NA 22 35 30 21 11 19 NA 20 28
## 9 5282 26 16 18 NA 23 31 17 26 14 23
## 10 5834 NA NA NA NA NA NA 13 NA NA NA
## # … with 46 more rows, and 7 more variables: `11` <dbl>, `12` <dbl>,
## # `13` <dbl>, `14` <dbl>, `15` <dbl>, `16` <dbl>, `17` <dbl>
##
## $PassingAttempts
## # A tibble: 56 x 18
## PlayerID `1` `2` `3` `4` `5` `6` `7` `8` `9` `10`
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 611 NA 34 NA 49 26 NA 39 15 52 NA
## 2 732 30 28 35 42 NA 35 33 29 38 29
## 3 2428 48 36 48 51 44 22 NA NA NA NA
## 4 2593 42 50 42 26 29 NA NA NA NA NA
## 5 3807 36 35 39 30 NA 25 24 31 NA 31
## 6 4314 36 39 35 45 40 38 29 47 NA 34
## 7 4737 NA NA NA NA NA NA NA NA 30 47
## 8 4932 NA 32 47 49 36 19 39 NA 36 37
## 9 5282 39 24 23 NA 30 47 27 33 20 39
## 10 5834 NA NA NA NA NA NA 21 NA NA NA
## # … with 46 more rows, and 7 more variables: `11` <dbl>, `12` <dbl>,
## # `13` <dbl>, `14` <dbl>, `15` <dbl>, `16` <dbl>, `17` <dbl>
##
## $PassingCompletionPercentage
## # A tibble: 56 x 18
## PlayerID `1` `2` `3` `4` `5` `6` `7` `8` `9` `10`
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 611 NA 73.5 NA 63.3 73.1 NA 69.2 66.7 65.4 NA
## 2 732 70 67.9 68.6 57.1 NA 68.6 69.7 62.1 63.2 75.9
## 3 2428 56.2 52.8 60.4 64.7 63.6 81.8 NA NA NA NA
## 4 2593 66.7 66 66.7 69.2 65.5 NA NA NA NA NA
## 5 3807 66.7 65.7 56.4 60 NA 68 58.3 54.8 NA 61.3
## 6 4314 44.4 76.9 71.4 71.1 75 52.6 72.4 68.1 NA 73.5
## 7 4737 NA NA NA NA NA NA NA NA 50 51.1
## 8 4932 NA 68.8 74.5 61.2 58.3 57.9 48.7 NA 55.6 75.7
## 9 5282 66.7 66.7 78.3 NA 76.7 66 63 78.8 70 59
## 10 5834 NA NA NA NA NA NA 61.9 NA NA NA
## # … with 46 more rows, and 7 more variables: `11` <dbl>, `12` <dbl>,
## # `13` <dbl>, `14` <dbl>, `15` <dbl>, `16` <dbl>, `17` <dbl>
##
## $PassingYards
## # A tibble: 56 x 18
## PlayerID `1` `2` `3` `4` `5` `6` `7` `8` `9` `10`
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 611 NA 217 NA 235 222 NA 186 101 261 NA
## 2 732 321 252 294 242 NA 248 233 254 313 215
## 3 2428 268 332 325 357 291 283 NA NA NA NA
## 4 2593 311 343 313 179 221 NA NA NA NA NA
## 5 3807 263 243 235 216 NA 252 224 317 NA 236
## 6 4314 267 447 378 307 303 257 249 333 NA 266
## 7 4737 NA NA NA NA NA NA NA NA 201 273
## 8 4932 NA 239 366 288 225 128 134 NA 220 273
## 9 5282 187 166 249 NA 194 354 209 257 140 262
## 10 5834 NA NA NA NA NA NA 188 NA NA NA
## # … with 46 more rows, and 7 more variables: `11` <dbl>, `12` <dbl>,
## # `13` <dbl>, `14` <dbl>, `15` <dbl>, `16` <dbl>, `17` <dbl>
##
## $PassingYardsPerAttempt
## # A tibble: 56 x 18
## PlayerID `1` `2` `3` `4` `5` `6` `7` `8` `9` `10`
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 611 NA 6.4 NA 4.8 8.5 NA 4.8 6.7 5 NA
## 2 732 10.7 9 8.4 5.8 NA 7.1 7.1 8.8 8.2 7.4
## 3 2428 5.6 9.2 6.8 7 6.6 12.9 NA NA NA NA
## 4 2593 7.4 6.9 7.5 6.9 7.6 NA NA NA NA NA
## 5 3807 7.3 6.9 6 7.2 NA 10.1 9.3 10.2 NA 7.6
## 6 4314 7.4 11.5 10.8 6.8 7.6 6.8 8.6 7.1 NA 7.8
## 7 4737 NA NA NA NA NA NA NA NA 6.7 5.8
## 8 4932 NA 7.5 7.8 5.9 6.2 6.7 3.4 NA 6.1 7.4
## 9 5282 4.8 6.9 10.8 NA 6.5 7.5 7.7 7.8 7 6.7
## 10 5834 NA NA NA NA NA NA 9 NA NA NA
## # … with 46 more rows, and 7 more variables: `11` <dbl>, `12` <dbl>,
## # `13` <dbl>, `14` <dbl>, `15` <dbl>, `16` <dbl>, `17` <dbl>
##
## $PassingTouchdowns
## # A tibble: 56 x 18
## PlayerID `1` `2` `3` `4` `5` `6` `7` `8` `9` `10`
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 611 NA 2 NA 1 0 NA 1 1 2 NA
## 2 732 1 1 2 1 NA 1 1 2 2 2
## 3 2428 1 1 2 1 1 3 NA NA NA NA
## 4 2593 1 2 3 4 3 NA NA NA NA NA
## 5 3807 2 2 1 1 NA 1 2 1 NA 2
## 6 4314 0 3 5 2 1 2 2 1 NA 3
## 7 4737 NA NA NA NA NA NA NA NA 2 1
## 8 4932 NA 1 3 2 2 1 1 NA 2 2
## 9 5282 0 2 1 NA 2 2 3 2 1 1
## 10 5834 NA NA NA NA NA NA 2 NA NA NA
## # … with 46 more rows, and 7 more variables: `11` <dbl>, `12` <dbl>,
## # `13` <dbl>, `14` <dbl>, `15` <dbl>, `16` <dbl>, `17` <dbl>
##
## $PassingInterceptions
## # A tibble: 56 x 18
## PlayerID `1` `2` `3` `4` `5` `6` `7` `8` `9` `10`
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 611 NA 1 NA 2 0 NA 0 0 2 NA
## 2 732 0 0 3 2 NA 1 0 0 1 1
## 3 2428 3 1 0 1 0 1 NA NA NA NA
## 4 2593 1 1 1 0 0 NA NA NA NA NA
## 5 3807 1 0 0 1 NA 1 0 1 NA 1
## 6 4314 0 0 0 0 1 1 0 0 NA 0
## 7 4737 NA NA NA NA NA NA NA NA 1 0
## 8 4932 NA 1 2 0 1 0 0 NA 1 0
## 9 5282 2 0 0 NA 1 2 1 0 0 1
## 10 5834 NA NA NA NA NA NA 1 NA NA NA
## # … with 46 more rows, and 7 more variables: `11` <dbl>, `12` <dbl>,
## # `13` <dbl>, `14` <dbl>, `15` <dbl>, `16` <dbl>, `17` <dbl>
##
## $PassingRating
## # A tibble: 56 x 18
## PlayerID `1` `2` `3` `4` `5` `6` `7` `8` `9` `10`
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 611 NA 97.3 NA 64.6 98.6 NA 88.2 108. 74.3 NA
## 2 732 116. 108. 77.6 61.8 NA 86.4 99.7 113. 95.6 105.
## 3 2428 53.1 82.2 94.5 83.5 90.2 139. NA NA NA NA
## 4 2593 86.5 90.7 103. 128. 123. NA NA NA NA NA
## 5 3807 95.0 105. 82.8 79.3 NA 97.4 117. 87.7 NA 92.9
## 6 4314 70.0 140. 146. 105. 94.1 80.7 121. 95.4 NA 125.
## 7 4737 NA NA NA NA NA NA NA NA 80 75.9
## 8 4932 NA 87.9 100. 91.2 83.7 95.9 65.5 NA 80.8 114.
## 9 5282 56.2 114. 126. NA 101. 84.9 108. 119. 106. 77.1
## 10 5834 NA NA NA NA NA NA 103. NA NA NA
## # … with 46 more rows, and 7 more variables: `11` <dbl>, `12` <dbl>,
## # `13` <dbl>, `14` <dbl>, `15` <dbl>, `16` <dbl>, `17` <dbl>
##
## $RushingAttempts
## # A tibble: 56 x 18
## PlayerID `1` `2` `3` `4` `5` `6` `7` `8` `9` `10`
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 611 NA 1 NA 0 3 NA 1 1 1 NA
## 2 732 3 1 1 1 NA 0 3 6 1 0
## 3 2428 1 3 3 2 0 5 NA NA NA NA
## 4 2593 7 2 4 1 4 NA NA NA NA NA
## 5 3807 3 2 1 1 NA 2 3 3 NA 2
## 6 4314 2 2 1 1 2 1 5 1 NA 1
## 7 4737 NA NA NA NA NA NA NA NA 4 1
## 8 4932 NA 0 0 3 0 1 0 NA 0 0
## 9 5282 2 4 4 NA 3 3 3 1 5 0
## 10 5834 NA NA NA NA NA NA 0 NA NA NA
## # … with 46 more rows, and 7 more variables: `11` <dbl>, `12` <dbl>,
## # `13` <dbl>, `14` <dbl>, `15` <dbl>, `16` <dbl>, `17` <dbl>
##
## $RushingYards
## # A tibble: 56 x 18
## PlayerID `1` `2` `3` `4` `5` `6` `7` `8` `9` `10`
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 611 NA -1 NA 0 -4 NA 0 9 7 NA
## 2 732 11 8 -1 8 NA 0 37 17 -1 0
## 3 2428 2 6 7 1 0 -4 NA NA NA NA
## 4 2593 21 8 23 -1 32 NA NA NA NA NA
## 5 3807 -8 -2 6 -1 NA -2 -3 -2 NA 5
## 6 4314 0 9 6 2 5 -1 5 2 NA 0
## 7 4737 NA NA NA NA NA NA NA NA 2 1
## 8 4932 NA 0 0 22 0 0 0 NA 0 0
## 9 5282 0 31 7 NA -3 21 1 0 13 0
## 10 5834 NA NA NA NA NA NA 0 NA NA NA
## # … with 46 more rows, and 7 more variables: `11` <dbl>, `12` <dbl>,
## # `13` <dbl>, `14` <dbl>, `15` <dbl>, `16` <dbl>, `17` <dbl>
##
## $RushingYardsPerAttempt
## # A tibble: 56 x 18
## PlayerID `1` `2` `3` `4` `5` `6` `7` `8` `9` `10`
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 611 NA -1 NA 0 -1.3 NA 0 9 7 NA
## 2 732 3.7 8 -1 8 NA 0 12.3 2.8 -1 0
## 3 2428 2 2 2.3 0.5 0 -0.8 NA NA NA NA
## 4 2593 3 4 5.8 -1 8 NA NA NA NA NA
## 5 3807 -2.7 -1 6 -1 NA -1 -1 -0.7 NA 2.5
## 6 4314 0 4.5 6 2 2.5 -1 1 2 NA 0
## 7 4737 NA NA NA NA NA NA NA NA 0.5 1
## 8 4932 NA 0 0 7.3 0 0 0 NA 0 0
## 9 5282 0 7.8 1.8 NA -1 7 0.3 0 2.6 0
## 10 5834 NA NA NA NA NA NA 0 NA NA NA
## # … with 46 more rows, and 7 more variables: `11` <dbl>, `12` <dbl>,
## # `13` <dbl>, `14` <dbl>, `15` <dbl>, `16` <dbl>, `17` <dbl>
##
## $RushingTouchdowns
## # A tibble: 56 x 18
## PlayerID `1` `2` `3` `4` `5` `6` `7` `8` `9` `10`
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 611 NA 0 NA 0 0 NA 0 0 0 NA
## 2 732 0 0 0 0 NA 0 0 0 0 0
## 3 2428 0 0 0 0 0 0 NA NA NA NA
## 4 2593 0 0 0 0 0 NA NA NA NA NA
## 5 3807 0 0 0 0 NA 0 0 0 NA 0
## 6 4314 0 0 0 0 0 0 0 0 NA 0
## 7 4737 NA NA NA NA NA NA NA NA 0 0
## 8 4932 NA 0 0 1 0 0 0 NA 0 0
## 9 5282 1 0 0 NA 0 0 1 0 1 0
## 10 5834 NA NA NA NA NA NA 0 NA NA NA
## # … with 46 more rows, and 7 more variables: `11` <dbl>, `12` <dbl>,
## # `13` <dbl>, `14` <dbl>, `15` <dbl>, `16` <dbl>, `17` <dbl>
##
## $FumblesLost
## # A tibble: 56 x 18
## PlayerID `1` `2` `3` `4` `5` `6` `7` `8` `9` `10`
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 611 NA 0 NA 0 0 NA 0 0 0 NA
## 2 732 0 0 0 1 NA 0 0 2 0 0
## 3 2428 0 0 0 0 0 0 NA NA NA NA
## 4 2593 0 1 0 0 0 NA NA NA NA NA
## 5 3807 0 0 1 0 NA 0 0 0 NA 0
## 6 4314 0 0 1 0 1 0 0 0 NA 0
## 7 4737 NA NA NA NA NA NA NA NA 0 0
## 8 4932 NA 0 0 0 1 0 1 NA 1 1
## 9 5282 0 1 0 NA 0 0 0 0 0 0
## 10 5834 NA NA NA NA NA NA 0 NA NA NA
## # … with 46 more rows, and 7 more variables: `11` <dbl>, `12` <dbl>,
## # `13` <dbl>, `14` <dbl>, `15` <dbl>, `16` <dbl>, `17` <dbl>
##
## $FantasyPoints
## # A tibble: 56 x 18
## PlayerID `1` `2` `3` `4` `5` `6` `7` `8` `9` `10`
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 611 NA 14.6 NA 9.4 8.48 NA 11.4 8.94 15.1 NA
## 2 732 17.9 14.9 13.7 8.48 NA 11.9 17.0 15.9 18.4 14.6
## 3 2428 8.92 15.9 21.7 16.4 15.6 20.9 NA NA NA NA
## 4 2593 16.5 18.5 24.8 23.1 24.0 NA NA NA NA NA
## 5 3807 15.7 17.5 12 10.5 NA 11.9 16.7 14.5 NA 17.9
## 6 4314 10.7 30.8 35.7 20.5 12.6 16.2 18.5 17.5 NA 22.6
## 7 4737 NA NA NA NA NA NA NA NA 14.2 15.0
## 8 4932 NA 11.6 22.6 27.7 13 9.12 7.36 NA 12.8 16.9
## 9 5282 9.48 15.7 14.7 NA 13.5 20.3 24.5 18.3 16.9 12.5
## 10 5834 NA NA NA NA NA NA 13.5 NA NA NA
## # … with 46 more rows, and 7 more variables: `11` <dbl>, `12` <dbl>,
## # `13` <dbl>, `14` <dbl>, `15` <dbl>, `16` <dbl>, `17` <dbl>
##
## $Team
## # A tibble: 56 x 18
## PlayerID `1` `2` `3` `4` `5` `6` `7` `8` `9` `10`
## <dbl> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
## 1 611 <NA> BAL <NA> BAL BAL <NA> BAL BAL BAL <NA>
## 2 732 ATL ATL ATL ATL <NA> ATL ATL ATL ATL ATL
## 3 2428 ARI ARI ARI ARI ARI ARI <NA> <NA> <NA> <NA>
## 4 2593 GB GB GB GB GB <NA> <NA> <NA> <NA> <NA>
## 5 3807 PIT PIT PIT PIT <NA> PIT PIT PIT <NA> PIT
## 6 4314 NE NE NE NE NE NE NE NE <NA> NE
## 7 4737 <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> ARI ARI
## 8 4932 <NA> NYG NYG NYG NYG NYG NYG <NA> NYG NYG
## 9 5282 NYJ NYJ NYJ <NA> NYJ NYJ NYJ NYJ NYJ NYJ
## 10 5834 <NA> <NA> <NA> <NA> <NA> <NA> MIA <NA> <NA> <NA>
## # … with 46 more rows, and 7 more variables: `11` <chr>, `12` <chr>,
## # `13` <chr>, `14` <chr>, `15` <chr>, `16` <chr>, `17` <chr>
for (panel in 1:length(QBPanels)) {
missing_plot <- vis_miss(as.data.frame(QBPanels[panel]))
print(missing_plot)
}
#QBdata_num <- QBCrossSectional[-c(1:3,5:16,29:36,39:52,55:56,74:89)]
#corr <- round(cor(QBdata_num), 1)
#ggcorrplot(corr, hc.order = TRUE,
# type = "full",
# lab = TRUE,
# lab_size = 1.5,
# method="square",
# colors = c("tomato2", "white", "springgreen3"),
# title="Correlogram of Quarterbacks", tl.cex = 7,pch=2,pch.col =3,show.diag = T,
# ggtheme=theme_classic)
#corrplot(corr, method="circle",tl.cex = 0.55,tl.col = "#1C1C1C")
QBX_ds <- QBCrossSectional[-c(1:6,21)]
corr <- round(cor(QBX_ds), 1)
ggcorrplot(corr, hc.order = TRUE,
type = "full",
lab = TRUE,
lab_size = 1.5,
method="square",
colors = c("tomato2", "white", "springgreen3"),
title="Correlogram of Quarterbacks", tl.cex = 7,pch=2,pch.col =3,show.diag = T,
ggtheme=theme_classic)
library(e1071)
par(mfrow=c(1, 2)) # divide graph area in 2 columns
target <- QBCrossSectional$FantasyPoints
plot(density(target), main="QBdata: FantasyPoints", ylab="Frequency", sub=paste("Skewness:", round(e1071::skewness(target), 2)))
polygon(density(target), col="red",asp=1.2 )
par(mfrow=c(1, 2)) # divide graph area in 2 columns
target <- QBCrossSectional$FantasyPoints
plot(density(target), main="CrossSectional Dataset: FantasyPoints", ylab="Frequency", sub=paste("Skewness:", round(e1071::skewness(target), 2)))
polygon(density(target), col="red")
I think we should do these by week - not team - we want to look at variance of the time series across obervations
QBCrossSectional %>% ggplot(aes(y=FantasyPoints,x=Week,fill=Week,group=Week))+
geom_boxplot(show.legend = FALSE)+
xlab("Week")+ylab("FantasyPoints")+
labs(title="Fantasyfootball",
subtitle="Weekly fantasypoints",
aption="Source: Fantasyfootball")+theme_economist()
for (i in 7:19) {
ggplotp <- QBCrossSectional %>% ggplot(aes_string(y=names(QBCrossSectional[i]),x=Week,fill=Week,group=Week))+
geom_boxplot(show.legend = FALSE)+
xlab("Week")+ylab(names(QBCrossSectional[i]))+
labs(title="Fantasyfootball",
subtitle="Weekly fantasypoints",
aption="Source: Fantasyfootball")+theme_economist()
print(ggplotp)
}
features_to_keep = c('PassingYards', 'PassingAttempts', 'PassingTouchdowns', 'PassingCompletions', 'PassingYardsPerAttempt')
for(f in features_to_keep){
hist = QBCrossSectional %>% ggplot(aes_string(x=f))+
geom_histogram(bins=30,aes(fill=Week),show.legend = FALSE)+
facet_wrap(~Week,ncol=8)+theme_economist()+theme(axis.text.x = element_text(angle = 45, hjust = 1))
print(hist)
}
Not sure that combining these is useful
attach(QBCrossSectional)
## The following objects are masked from QBCrossSectional (pos = 4):
##
## FantasyPoints, FumblesLost, GameDate, Opponent,
## PassingAttempts, PassingCompletionPercentage,
## PassingCompletions, PassingInterceptions, PassingRating,
## PassingTouchdowns, PassingYards, PassingYardsPerAttempt,
## PlayerID, Position, RushingAttempts, RushingTouchdowns,
## RushingYards, RushingYardsPerAttempt, Team, TeamIsHome, Week
## The following object is masked from package:ggplot2:
##
## Position
QBCrossSectional %>% ggplot(aes(y=FantasyPoints,x=PassingCompletions+PassingAttempts+
PassingCompletionPercentage+
PassingYards+PassingYardsPerAttempt+
PassingTouchdowns+PassingInterceptions+
PassingRating+RushingAttempts+RushingYards+
RushingYardsPerAttempt+RushingTouchdowns+FumblesLost,
color=Opponent))+
xlab("Relationship of predictors with each Opponent")+
geom_point()+
geom_smooth(method="lm",se=F)+
theme(axis.text.x = element_text(angle=65, vjust=0.6))+facet_wrap(~Opponent)
Same here…..
attach(QBCrossSectional)
## The following objects are masked from QBCrossSectional (pos = 3):
##
## FantasyPoints, FumblesLost, GameDate, Opponent,
## PassingAttempts, PassingCompletionPercentage,
## PassingCompletions, PassingInterceptions, PassingRating,
## PassingTouchdowns, PassingYards, PassingYardsPerAttempt,
## PlayerID, Position, RushingAttempts, RushingTouchdowns,
## RushingYards, RushingYardsPerAttempt, Team, TeamIsHome, Week
## The following objects are masked from QBCrossSectional (pos = 5):
##
## FantasyPoints, FumblesLost, GameDate, Opponent,
## PassingAttempts, PassingCompletionPercentage,
## PassingCompletions, PassingInterceptions, PassingRating,
## PassingTouchdowns, PassingYards, PassingYardsPerAttempt,
## PlayerID, Position, RushingAttempts, RushingTouchdowns,
## RushingYards, RushingYardsPerAttempt, Team, TeamIsHome, Week
## The following object is masked from package:ggplot2:
##
## Position
QBCrossSectional %>% ggplot(aes(y=FantasyPoints,x=PassingCompletions+PassingAttempts+
PassingCompletionPercentage+
PassingYards+PassingYardsPerAttempt+
PassingTouchdowns+PassingInterceptions+
PassingRating+RushingAttempts+RushingYards+
RushingYardsPerAttempt+RushingTouchdowns+FumblesLost,
color=TeamIsHome))+
geom_point()+
geom_smooth(method="lm",se=F)+
theme(axis.text.x = element_text(angle=65, vjust=0.6))+facet_wrap(~TeamIsHome)
and here……
attach(QBCrossSectional)
## The following objects are masked from QBCrossSectional (pos = 3):
##
## FantasyPoints, FumblesLost, GameDate, Opponent,
## PassingAttempts, PassingCompletionPercentage,
## PassingCompletions, PassingInterceptions, PassingRating,
## PassingTouchdowns, PassingYards, PassingYardsPerAttempt,
## PlayerID, Position, RushingAttempts, RushingTouchdowns,
## RushingYards, RushingYardsPerAttempt, Team, TeamIsHome, Week
## The following objects are masked from QBCrossSectional (pos = 4):
##
## FantasyPoints, FumblesLost, GameDate, Opponent,
## PassingAttempts, PassingCompletionPercentage,
## PassingCompletions, PassingInterceptions, PassingRating,
## PassingTouchdowns, PassingYards, PassingYardsPerAttempt,
## PlayerID, Position, RushingAttempts, RushingTouchdowns,
## RushingYards, RushingYardsPerAttempt, Team, TeamIsHome, Week
## The following objects are masked from QBCrossSectional (pos = 6):
##
## FantasyPoints, FumblesLost, GameDate, Opponent,
## PassingAttempts, PassingCompletionPercentage,
## PassingCompletions, PassingInterceptions, PassingRating,
## PassingTouchdowns, PassingYards, PassingYardsPerAttempt,
## PlayerID, Position, RushingAttempts, RushingTouchdowns,
## RushingYards, RushingYardsPerAttempt, Team, TeamIsHome, Week
## The following object is masked from package:ggplot2:
##
## Position
QBCrossSectional %>% ggplot(aes(y=FantasyPoints,x=PassingCompletions+PassingAttempts+
PassingCompletionPercentage+
PassingYards+PassingYardsPerAttempt+
PassingTouchdowns+PassingInterceptions+
PassingRating+RushingAttempts+
RushingYards+RushingYardsPerAttempt+
RushingTouchdowns+FumblesLost,color=Team)) +
geom_point()+
geom_smooth(method="lm",se=F)+
theme(axis.text.x = element_text(angle=65, vjust=0.6))+facet_wrap(~Team)
This makes sense - but we are actually trying to capture what the NEXT value for fantasy points is likely to be - these are all going to be highly correlated to the current
week since the fantasy score is a linear combination of the predictors for any given week. We need to shift the data (and z-score it?) before running these charts.
for (i in 7:19) {
linear_plot <- QBCrossSectional %>%
ggplot(aes_string(y="FantasyPoints",x=names(QBCrossSectional[i]))) +
geom_point()+geom_smooth(method="lm",se=F)+
theme(axis.text.x = element_text(angle=65, vjust=0.6))+
theme_economist()
print(linear_plot)
}
Drop rushing yards per attempt
defensive_positions = getFootballData("https://fantasydata.com/FantasyStatsNFL/FantasyStats_Read?sort=FantasyPoints-desc&pageSize=4000&group=&filter=&filters.position=8&filters.team=&filters.teamkey=&filters.season=2017&filters.seasontype=1&filters.scope=2&filters.subscope=1&filters.redzonescope=&filters.scoringsystem=&filters.leaguetype=&filters.searchtext=&filters.week=&filters.startweek=1&filters.endweek=17&filters.minimumsnaps=&filters.teamaspect=&filters.stattype=&filters.exportType=&filters.desktop=&filter#s.dfsoperator=&filters.dfsslateid=&filters.dfsslategameid=&filters.dfsrosterslot=&filters.page=&filters.showfavs=&filters.posgroup=&filters.oddsstate=&filters.aggregatesc#ope=1&filters.rangescope=&filters.range=1")
defensive_positions$StatSummary = c(NULL)
team_defense = getFootballData("https://fantasydata.com/FantasyStatsNFL/FantasyStats_Read?sort=FantasyPoints-desc&pageSize=4000&group=&filter=&filters.position=7&filters.team=&filters.teamkey=&filters.season=2017&filters.seasontype=1&filters.scope=2&filters.subscope=1&filters.redzonescope=&filters.scoringsystem=&filters.leaguetype=&filters.searchtext=&filters.week=&filters.startweek=1&filters.endweek=17&filters.minimumsnaps=&filters.teamaspect=&filters.stattype=&filters.exportType=&filters.desktop=&filters.dfsoperator=&filters.dfsslateid=&filters.dfsslategameid=&filters.dfsrosterslot=&filters.page=&filters.showfavs=&filters.posgroup=&filters.oddsstate=&filters.aggregatescope=1&filters.rangescope=&filters.range=1")
team_defense$StatSummary = c(NULL)
defensive_players_by_week = sqldf("SELECT
Week,
FantasyPosition,
Count(*)
FROM defensive_positions
GROUP BY Week, FantasyPosition")
team_defense_by_week = sqldf("SELECT
Week,
FantasyPosition,
Count(*)
FROM team_defense
GROUP BY Week, FantasyPosition")
# this looks good some teams are on bye in certain weeks
defensive_columns = c('Team', 'Week', 'TacklesForLoss', 'Sacks', 'QuarterbackHits', 'Interceptions', 'FumblesRecovered', 'Safeties', 'DefensiveTouchdowns', 'SoloTackles', 'AssistedTackles', 'SackYards', 'PassesDefended', 'FumblesForced', 'FantasyPoints', 'PointsAllowedByDefenseSpecialTeams')
team_defense = team_defense %>% select(defensive_columns) %>% rename('DefensiveFantasyPoints'='FantasyPoints') %>% group_by(Week) %>%
mutate(WeeklyRank = dense_rank(DefensiveFantasyPoints))
# mutate(PlayerName = paste(FirstName," ",LastName))
attach(team_defense)
## The following objects are masked from QBCrossSectional (pos = 3):
##
## Team, Week
## The following objects are masked from QBCrossSectional (pos = 4):
##
## Team, Week
## The following objects are masked from QBCrossSectional (pos = 5):
##
## Team, Week
## The following objects are masked from QBCrossSectional (pos = 7):
##
## Team, Week
team_defense$Week = as.factor(team_defense$Week)
sqldf("SELECT Week, Team, WeeklyRank FROM team_defense WHERE Week IN(1, 2) ORDER BY Team, Week")
## Week Team WeeklyRank
## 1 1 ARI 8
## 2 2 ARI 12
## 3 1 ATL 6
## 4 2 ATL 14
## 5 1 BAL 14
## 6 2 BAL 15
## 7 1 BUF 9
## 8 2 BUF 12
## 9 1 CAR 11
## 10 2 CAR 12
## 11 1 CHI 3
## 12 2 CHI 6
## 13 1 CIN 5
## 14 2 CIN 9
## 15 1 CLE 4
## 16 2 CLE 8
## 17 1 DAL 10
## 18 2 DAL 4
## 19 1 DEN 4
## 20 2 DEN 14
## 21 1 DET 12
## 22 2 DET 15
## 23 1 GB 9
## 24 2 GB 4
## 25 1 HOU 1
## 26 2 HOU 11
## 27 1 IND 3
## 28 2 IND 9
## 29 1 JAX 15
## 30 2 JAX 3
## 31 1 KC 4
## 32 2 KC 13
## 33 1 LAC 8
## 34 2 LAC 5
## 35 1 LAR 15
## 36 2 LAR 4
## 37 2 MIA 4
## 38 1 MIN 3
## 39 2 MIN 4
## 40 1 NE 2
## 41 2 NE 4
## 42 1 NO 1
## 43 2 NO 2
## 44 1 NYG 3
## 45 2 NYG 7
## 46 1 NYJ 5
## 47 2 NYJ 1
## 48 1 OAK 3
## 49 2 OAK 11
## 50 1 PHI 13
## 51 2 PHI 6
## 52 1 PIT 12
## 53 2 PIT 10
## 54 1 SEA 7
## 55 2 SEA 10
## 56 1 SF 5
## 57 2 SF 9
## 58 2 TB 16
## 59 1 TEN 3
## 60 2 TEN 11
## 61 1 WAS 10
## 62 2 WAS 9
QBCrossSectionalDefensiveOverlay = QBCrossSectional %>% left_join(team_defense, by = c('Week'='Week', 'Opponent'='Team'))
#Should we just train on second half of 2017?
QBCrossSectionalDefensiveOverlayCumulativePassYards = QBCrossSectionalDefensiveOverlay %>% group_by(PlayerID) %>% arrange(Week) %>% mutate(CumulativeAveragePassingYards=cummean(PassingYards)
, CumulativeAveragePassingTouchdowns=cummean(PassingTouchdowns)
, CumulativeAverageCompletions = cummean(PassingCompletions) # not sure that completions matter much - most leagues don't reward them
, CumulativeMaxPassingTouchdowns = cummax(PassingTouchdowns)
, CumulativeMaxPassingYards = cummax(PassingYards)
, CumulativeMaxPassingAttempts = cummax(PassingAttempts)
, CumulativeMaxPassingRating = cummax(PassingRating)
, CumulativeMaxCompletions = cummax(PassingCompletions)
, CumulativeMaxPassYardsPerAttempt = cummax(PassingYardsPerAttempt)
, CumulativeMinPassingTouchdowns = cummin(PassingTouchdowns)
, CumulativeMinPassingYards = cummin(PassingYards) #Let's get mins to capture downside risk
, CumulativeMinPassingAttempts = cummin(PassingAttempts)
, CumulativeMinPassingRating = cummin(PassingRating)
, CumulativeMinCompletions = cummin(PassingCompletions)
, CumulativeMinPassYardsPerAttempt = cummin(PassingYardsPerAttempt)
, LastWeekQuarterBackRating = lag(PassingRating)
, LastWeekQuarterPassingYards = lag(PassingYards)
, LastWeekQuarterPassingTouchdowns = lag(PassingTouchdowns)
, NextWeekFantasyPoints = lead(FantasyPoints) #Target Variable
)
QBCrossSectionalDefensiveOverlayCumulativePassYards %>% filter(PlayerID == 6739) %>% write.csv('alex_smith.csv') #Alex Smith did indeed pass for 4042 yards on the season:)
final_ds <- QBCrossSectionalDefensiveOverlayCumulativePassYards
attach(QBCrossSectionalDefensiveOverlayCumulativePassYards)
## The following objects are masked from team_defense:
##
## AssistedTackles, DefensiveFantasyPoints, DefensiveTouchdowns,
## FumblesForced, FumblesRecovered, Interceptions,
## PassesDefended, PointsAllowedByDefenseSpecialTeams,
## QuarterbackHits, Sacks, SackYards, Safeties, SoloTackles,
## TacklesForLoss, Team, Week, WeeklyRank
## The following objects are masked from QBCrossSectional (pos = 4):
##
## FantasyPoints, FumblesLost, GameDate, Opponent,
## PassingAttempts, PassingCompletionPercentage,
## PassingCompletions, PassingInterceptions, PassingRating,
## PassingTouchdowns, PassingYards, PassingYardsPerAttempt,
## PlayerID, Position, RushingAttempts, RushingTouchdowns,
## RushingYards, RushingYardsPerAttempt, Team, TeamIsHome, Week
## The following objects are masked from QBCrossSectional (pos = 5):
##
## FantasyPoints, FumblesLost, GameDate, Opponent,
## PassingAttempts, PassingCompletionPercentage,
## PassingCompletions, PassingInterceptions, PassingRating,
## PassingTouchdowns, PassingYards, PassingYardsPerAttempt,
## PlayerID, Position, RushingAttempts, RushingTouchdowns,
## RushingYards, RushingYardsPerAttempt, Team, TeamIsHome, Week
## The following objects are masked from QBCrossSectional (pos = 6):
##
## FantasyPoints, FumblesLost, GameDate, Opponent,
## PassingAttempts, PassingCompletionPercentage,
## PassingCompletions, PassingInterceptions, PassingRating,
## PassingTouchdowns, PassingYards, PassingYardsPerAttempt,
## PlayerID, Position, RushingAttempts, RushingTouchdowns,
## RushingYards, RushingYardsPerAttempt, Team, TeamIsHome, Week
## The following objects are masked from QBCrossSectional (pos = 8):
##
## FantasyPoints, FumblesLost, GameDate, Opponent,
## PassingAttempts, PassingCompletionPercentage,
## PassingCompletions, PassingInterceptions, PassingRating,
## PassingTouchdowns, PassingYards, PassingYardsPerAttempt,
## PlayerID, Position, RushingAttempts, RushingTouchdowns,
## RushingYards, RushingYardsPerAttempt, Team, TeamIsHome, Week
## The following object is masked from package:ggplot2:
##
## Position
for(p in 37:51){
#print(paste("violin plots for ",names(players_ds[p])))
for (player in seq(1,length(unique(final_ds$PlayerID)),by=30)){
a_size <- player + 29
players_ds <- final_ds %>% filter(PlayerID %in% unique(final_ds$PlayerID)[player:a_size])
line_plot <- players_ds %>%
ggplot(aes_string(x="as.numeric(Week)",y=names(players_ds[p])))+
ggtitle(names(players_ds[p]))+
geom_line(show.legend = FALSE)+
xlab("PlayerID")+
ylab(names(players_ds[p]))+
labs(title="Fantasyfootball",
subtitle=names(players_ds[p]),
aption="Source: Fantasyfootball")+
theme_economist(base_size=8)+theme(axis.text.y = element_text(size=5))+
theme(axis.text.x = element_text(angle=65, vjust=0.6))+facet_wrap(~PlayerID)
suppressWarnings(print(line_plot))
}
}
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?
for(p in 37:51){
#print(paste("violin plots for ",names(players_ds[p])))
for (player in seq(1,length(unique(final_ds$PlayerID)),by=20)){
a_size <- player + 19
players_ds <- final_ds %>% filter(PlayerID %in% unique(final_ds$PlayerID)[player:a_size])
v_plot <- players_ds %>%
ggplot(aes_string(x="as.factor(PlayerID)",y=names(players_ds[p]),fill="as.factor(PlayerID)"))+
ggtitle(names(players_ds[p]))+
geom_violin(show.legend = FALSE)+
xlab("PlayerID")+
ylab(names(players_ds[p]))+
labs(title="Fantasyfootball",
subtitle=names(players_ds[p]),
aption="Source: Fantasyfootball")+
theme_economist(base_size=8)+theme(axis.text.y = element_text(size=5))+
theme(axis.text.x = element_text(angle=65, vjust=0.6))
print(v_plot)
}
}
str(final_ds)
## Classes 'grouped_df', 'tbl_df', 'tbl' and 'data.frame': 453 obs. of 55 variables:
## $ PlayerID : num 6739 9038 11527 17009 17920 ...
## $ Week : Factor w/ 17 levels "1","2","3","4",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ Position : chr "QB" "QB" "QB" "QB" ...
## $ Opponent : chr "NE" "ARI" "NO" "LAC" ...
## $ TeamIsHome : logi FALSE TRUE TRUE TRUE FALSE TRUE ...
## $ GameDate : Date, format: "2017-09-07" "2017-09-10" ...
## $ PassingCompletions : num 28 29 27 17 26 25 16 22 20 21 ...
## $ PassingAttempts : num 35 41 32 28 39 41 28 32 30 30 ...
## $ PassingCompletionPercentage : num 80 70.7 84.4 60.7 66.7 61 57.1 68.8 66.7 70 ...
## $ PassingYards : num 368 292 346 219 307 256 224 262 222 321 ...
## $ PassingYardsPerAttempt : num 10.5 7.1 10.8 7.8 7.9 6.2 8 8.2 7.4 10.7 ...
## $ PassingTouchdowns : num 4 4 3 2 2 0 2 2 1 1 ...
## $ PassingInterceptions : num 0 1 0 1 1 0 1 0 1 0 ...
## $ PassingRating : num 148.6 113.1 143 94.2 96.8 ...
## $ RushingAttempts : num 5 2 2 6 4 3 8 2 5 3 ...
## $ RushingYards : num 3 14 -3 19 6 26 38 2 17 11 ...
## $ RushingYardsPerAttempt : num 0.6 7 -1.5 3.2 1.5 8.7 4.8 1 3.4 3.7 ...
## $ RushingTouchdowns : num 0 0 0 1 0 1 0 0 1 0 ...
## $ FumblesLost : num 0 0 0 0 1 0 0 0 0 0 ...
## $ FantasyPoints : num 31 27.1 25.5 22.7 18.9 ...
## $ Team : chr "KC" "DET" "MIN" "DEN" ...
## $ TacklesForLoss : num 4 6 6 5 5 4 7 3 10 4 ...
## $ Sacks : num 3 1 1 4 2 1 2 2 7 2 ...
## $ QuarterbackHits : num 4 4 2 9 9 4 6 3 8 5 ...
## $ Interceptions : num 0 1 0 1 1 0 1 0 1 0 ...
## $ FumblesRecovered : num 1 0 0 1 1 0 0 0 0 0 ...
## $ Safeties : num 0 0 0 0 0 0 0 0 0 0 ...
## $ DefensiveTouchdowns : num 0 1 0 0 1 0 0 0 0 0 ...
## $ SoloTackles : num 50 54 50 45 43 39 56 41 45 38 ...
## $ AssistedTackles : num 13 12 20 22 18 16 26 18 21 12 ...
## $ SackYards : num 16 7 5 38 9 1 6 12 42 13 ...
## $ PassesDefended : num 3 6 2 5 8 5 5 3 3 4 ...
## $ FumblesForced : num 1 0 1 1 0 0 0 0 0 0 ...
## $ DefensiveFantasyPoints : num 1 8 0 8 12 2 4 2 16 2 ...
## $ PointsAllowedByDefenseSpecialTeams: num 42 29 29 24 24 16 21 26 18 23 ...
## $ WeeklyRank : int 2 8 1 8 10 3 5 3 12 3 ...
## $ CumulativeAveragePassingYards : num 368 292 346 219 307 256 224 262 222 321 ...
## $ CumulativeAveragePassingTouchdowns: num 4 4 3 2 2 0 2 2 1 1 ...
## $ CumulativeAverageCompletions : num 28 29 27 17 26 25 16 22 20 21 ...
## $ CumulativeMaxPassingTouchdowns : num 4 4 3 2 2 0 2 2 1 1 ...
## $ CumulativeMaxPassingYards : num 368 292 346 219 307 256 224 262 222 321 ...
## $ CumulativeMaxPassingAttempts : num 35 41 32 28 39 41 28 32 30 30 ...
## $ CumulativeMaxPassingRating : num 148.6 113.1 143 94.2 96.8 ...
## $ CumulativeMaxCompletions : num 28 29 27 17 26 25 16 22 20 21 ...
## $ CumulativeMaxPassYardsPerAttempt : num 10.5 7.1 10.8 7.8 7.9 6.2 8 8.2 7.4 10.7 ...
## $ CumulativeMinPassingTouchdowns : num 4 4 3 2 2 0 2 2 1 1 ...
## $ CumulativeMinPassingYards : num 368 292 346 219 307 256 224 262 222 321 ...
## $ CumulativeMinPassingAttempts : num 35 41 32 28 39 41 28 32 30 30 ...
## $ CumulativeMinPassingRating : num 148.6 113.1 143 94.2 96.8 ...
## $ CumulativeMinCompletions : num 28 29 27 17 26 25 16 22 20 21 ...
## $ CumulativeMinPassYardsPerAttempt : num 10.5 7.1 10.8 7.8 7.9 6.2 8 8.2 7.4 10.7 ...
## $ LastWeekQuarterBackRating : num NA NA NA NA NA NA NA NA NA NA ...
## $ LastWeekQuarterPassingYards : num NA NA NA NA NA NA NA NA NA NA ...
## $ LastWeekQuarterPassingTouchdowns : num NA NA NA NA NA NA NA NA NA NA ...
## $ NextWeekFantasyPoints : num 16.1 13.2 NA 22.6 24.8 ...
## - attr(*, "groups")=Classes 'tbl_df', 'tbl' and 'data.frame': 56 obs. of 2 variables:
## ..$ PlayerID: num 611 732 2428 2593 3807 ...
## ..$ .rows :List of 56
## .. ..$ : int 40 107 133 181 208 228 284 311 322 358 ...
## .. ..$ : int 10 39 77 109 154 173 197 221 254 276 ...
## .. ..$ : int 23 36 67 97 122 139
## .. ..$ : int 13 30 62 90 116 381
## .. ..$ : int 15 32 79 103 155 174 199 245 264 288 ...
## .. ..$ : int 19 25 55 93 127 143 172 193 242 266 ...
## .. ..$ : int 229 252 418 450
## .. ..$ : int 47 65 86 126 159 186 231 247 285 368 ...
## .. ..$ : int 22 37 76 124 142 166 190 225 259 291 ...
## .. ..$ : int 178 277 312
## .. ..$ : int 1 34 75 88 114 145 165 200 222 287 ...
## .. ..$ : int 16 28 68 95 156 170 203 220 257 267 ...
## .. ..$ : int 11 33 94 118 147 176 206 251 274 289 ...
## .. ..$ : int 140 233 261 269 310
## .. ..$ : int 61 110 117
## .. ..$ : int 135
## .. ..$ : int 42 80 153 180 215 255 334 349 412
## .. ..$ : int 2 41 72 104 123 146 191 217 243 272 ...
## .. ..$ : int 3
## .. ..$ : int 7 49 71 100 132 169 195 212 273 307 ...
## .. ..$ : int 52 73 85 125 183 189 253 271 299 321 ...
## .. ..$ : int 355 400
## .. ..$ : int 270 301 340 370
## .. ..$ : int 17 46 81 84 115 141 185 201 218 236 ...
## .. ..$ : int 377 424
## .. ..$ : int 234 260 279 378 425
## .. ..$ : int 20 45 60 92 136 167 205 235 237 265 ...
## .. ..$ : int 24 38 56 87 130 164 187 216 244 263 ...
## .. ..$ : int 128
## .. ..$ : int 342
## .. ..$ : int 449
## .. ..$ : int 18 50
## .. ..$ : int 57 108 129 152 192 240 275 290 327 353 ...
## .. ..$ : int 339 360 384 404 436
## .. ..$ : int 232 281 329
## .. ..$ : int 21 51 59 101 150 175 226 248 286 294 ...
## .. ..$ : int 8 29 105 162 202 230 282 304 330 366 ...
## .. ..$ : int 432
## .. ..$ : int 44 74 89 119 168 323 362 376 416 429
## .. ..$ : int 6 43 70 98 148 184 227 246 278 314 ...
## .. ..$ : int 399 448
## .. ..$ : int 179 223 256 295 344 348 447
## .. ..$ : int 4 27 82 102 144 209 305 364
## .. ..$ : int 5 26 78 99 113 138 161 194 214 268 ...
## .. ..$ : int 14 48 63 96 134 157 171 211 238 283 ...
## .. ..$ : int 439
## .. ..$ : int 53 58 106 120 149 182 196 219 250 315 ...
## .. ..$ : int 12 35 64 91 112 163 210 213 258 332 ...
## .. ..$ : int 54 121 160
## .. ..$ : int 451
## .. ..$ : int 131 158 207 249 280 341 351 397 405 453
## .. ..$ : int 31 69 83 111 137 188
## .. ..$ : int 9 66 198 241 297 335 356 428
## .. ..$ : int 445
## .. ..$ : int 151 177 204 224 239 313
## .. ..$ : int 262 373
## ..- attr(*, ".drop")= logi TRUE